<?php

namespace api\controllers;


use common\components\sign\Sign;
use common\components\sign\SignException;
use common\helpers\ResultHelper;

class BaseController extends AController
{
    protected array $authOptional = ['sign'];

    /**
     * 签名测试
     * @return array
     * @throws SignException
     */
    public function actionSign():array
    {
        $Sign = new Sign();
        $body = $this->request->bodyParams;
        $signString = $Sign->getSign($body);
        return ResultHelper::json(200, '签名成功', [
            'sign'=>$signString,
            'body'=>$body
        ]);
    }

}